<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>云课堂后台管理系统</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
  <link rel="stylesheet" href="/layui/dist/css/layui.css">
  <link rel="stylesheet" href="/stylesheets/common.css">
  <script src="/javascripts/jquery.js"></script>
  <script src="/layui/dist/layui.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
  <script src="/javascripts/backstage.js" type="module"></script>
</head>
<body>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
          <div class="layui-logo layui-hide-xs layui-bg-black" style="color: #fff;">云课堂后台</div>
          <!-- 头部区域（可配合layui 已有的水平导航） -->
          <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
              <a href="javascript:;">
                <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
                <%= aname %>
              </a>
              <dl class="layui-nav-child">
                <dd><a id="logout">退出登录</a></dd>
              </dl>
            </li>
            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
              <a href="javascript:;">
                <i class="layui-icon layui-icon-more-vertical"></i>
              </a>
            </li>
          </ul>
        </div>
        
        <div class="layui-side layui-bg-black">
          <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                  <% roleArr.forEach(function(once){%>
                  <li class="layui-nav-item layui-nav-itemed">
                    <a href="<%= once.rule_url%>"><%=once.rule_name%></a>
                    
                    <% if (once.rule_name == '用户管理') {%>
                       <dl class="layui-nav-child">
                        <dd><a href="/backstage/teacher">教师管理</a></dd>
                        <dd><a href="/backstage/student">学生管理</a></dd>
                      <!-- <dd><a href="">跳转</a></dd> -->
                    </dl>
                    <%}%>
                   
                  </li>
                  <%})%>
                </ul>
        </div>
        </div>
        
        <div class="layui-body">
          <!-- 内容主体区域 -->
          <button type="button" id="addAuthority" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">添加课程</button>
           <table class="layui-table">
        <colgroup>
          <col width="150">
          <col width="200">
          <col>
        </colgroup>
        <thead>
          <tr>
            <th>课程名称</th>
            <th>选课学生数</th>
            <th>级别</th>
            <th>收藏人数</th>
            <th style="width: 10%;">操作</th>
          </tr>
        </thead>
        <tbody>
          <% courseArr.forEach(function(once) {%>
            <tr>
              <td><%= once.ctitle %></td>
              <td><%= once.signup_number %></td>
              <td><%= once.ctype %></td>
              <td><%= once.collection_number %></td>
              <td style="width: 10%;">
                <a id="delCourse" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
              </td>
            </tr>
          <%})%>
        </tbody>
      </table>
          
        </div>

        <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="exampleModalLabel">添加课程</h4>
          </div>
          <div class="modal-body">
            <form>
              <div class="form-group">
                <label for="recipient-name" class="control-label">课程名称:</label>
                <input type="text" class="form-control" id="course-name">
              </div>
              <div class="form-group">
                <label for="message-text" class="control-label">级别:</label>
                <input type="text" class="form-control" id="type-name">
              </div>
            </form>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            <button type="button" id="sureAddCourse" class="btn btn-primary">添加</button>
          </div>
        </div>
      </div>
    </div>
        
      </div>

</body>
</html>